package com.maxmlr.framework.mybatisplus.executor;

import com.maxmlr.framework.mybatisplus.config.Configuration;
import com.maxmlr.framework.mybatisplus.mapper.MapperData;
import com.maxmlr.framework.mybatisplus.result.ResultSetHandler;
import com.maxmlr.framework.mybatisplus.statement.StatementHandler;
import lombok.AllArgsConstructor;

import java.util.List;

/**
 * @ClassName DefaultExecutor
 * @Description TODO
 * @Author maxiao
 * @Date 2020/3/23 下午2:29
 * @Version V1.0
 */
@AllArgsConstructor
public class DefaultExecutor implements Executor {
    private Configuration configuration;

    @Override
    public <T> List<T> query(MapperData<T> mapperData, Object var2) throws Exception {
        ResultSetHandler resultSetHandler = new ResultSetHandler(configuration);
        StatementHandler statementHandler = new StatementHandler(configuration, resultSetHandler);
        return statementHandler.query(mapperData, var2);
    }
}
